<script lang="ts">
import {defineComponent} from 'vue'
  export default defineComponent({
    name: "ClassOption",
    data(){
      return {
        message:'班级组件'
      }
    },
    methods:{
      busSendMsg(){
        console.log(6666)
        // 通过总线发送消息
        this.$bus.$emit('messageSent',777886666)
      }
    }
  })
</script>

<template>
  <div class="classOption">
    <h2>{{message}}</h2>
    <hr/>
    <button @click="busSendMsg">点我发送消息</button>
  </div>
</template>

<style scoped>
  .classOption{
    background-color: #42b983;
  }
</style>
